<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page session="false" %>

<div class="box">
	<form:form action="${pageContext.request.contextPath}/patient/add" method="post" modelAttribute="patientForm">
		<table>
			<tr><td>First Name</td><td><form:input path="firstName"/></td></tr>
			<tr><td>Last Name</td><td><form:input path="lastName"/></td></tr>
			<tr><td>Date of Birth</td><td><form:input path="dateOfBirth"/></td></tr>
			<tr>
				<td>Nationality</td>
				<td>
					<form:select path="nationality.idNationality">
						<form:option value="-1" label="Select one..."  />
						<form:options items="${nationalities}" itemValue="idNationality" itemLabel="name"/>
					</form:select>
				</td>
			</tr>
			<tr><td>Street</td><td><form:input path="address.street"/></td></tr>
			<tr><td>Post Code</td><td><form:input path="address.postCode"/></td></tr>
			<tr>
				<td>Suburb</td>
				<td>
					<form:select path="address.suburb.idSuburb">
						<form:option value="-1" label="Select one..."  />
						<form:options items="${suburbs}" itemValue="idSuburb" itemLabel="name"/>
					</form:select>
				</td>
			</tr>
			<tr>
				<td>State</td>
				<td>
					<form:select path="address.state.idState">
						<form:option value="-1" label="Select one..."  />
						<form:options items="${states}" itemValue="idState" itemLabel="name"/>
					</form:select>
				</td>
			</tr>
			<tr><td>Home Phone</td><td><form:input path="homePhone"/></td></tr>
			<tr><td>Mobile Phone</td><td><form:input path="mobilePhone"/></td></tr>
			<tr><td>Email</td><td><form:input path="email"/></td></tr>
			<tr>
				<td>Blood Type</td>
				<td>
					<form:select path="bloodType.idBloodType">
						<form:option value="-1" label="Select one..."  />
						<form:options items="${bloodTypes}" itemValue="idBloodType" itemLabel="code"/>
					</form:select>
				</td>
			</tr>
			<tr><td>Medical History</td><td><form:textarea path="medicalHistory" rows="4" cols="50" /></td></tr>
			<tr><td>Notes</td><td><form:textarea path="notes" rows="4" cols="50" /></td></tr>
		</table>

		<input type="submit" value="Submit" class="button"/>
	</form:form>
	
</div>